package cn.minsh.lims.eoms.modules.app.controller;

import cn.minsh.lims.eoms.modules.app.controller.res.InspectionPlanRes;
import cn.minsh.lims.eoms.modules.app.enums.PlanStatusEnum;
import cn.minsh.lims.eoms.modules.app.service.InspectionPlanService;
import cn.minsh.lims.eoms.modules.app.service.UserInspectionPlanService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@Api(tags = "手动定时任务")
public class TestController {
    @Autowired
    private InspectionPlanService inspectionPlanService;
    @Autowired
    private UserInspectionPlanService userInspectionPlanService ;


    @GetMapping("task")
    @ApiOperation("执行添巡检工单")
    public void task(){
        List<InspectionPlanRes> list = inspectionPlanService.queryInspectionPlanList(PlanStatusEnum.STARTED.getCode()) ;
        userInspectionPlanService.saveBatchUserPlan(list); ;
    }
}
